<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>AI填卡助手</title>
  <link rel="stylesheet" href="popup.css">
</head>

<body>
  <div class="container">
    <!-- 固定顶部标题栏 -->
    <div class="fixed-header">
      <div class="contact-header">
        <div class="header-title">AI填卡助手</div>
        <div class="header-version">构建版本：<span id="versionNumber"></span></div>
      </div>
    </div>

    <!-- 可滚动内容区域 -->
    <div class="scrollable-content">
      <!-- 页面状态检测 -->
      <div class="page-status">
        <div class="status-label">当前页面：</div>
        <div class="status-value" id="pageStatus">
          <span class="status-icon">🔍</span>
          <span class="status-text">检测中...</span>
        </div>
      </div>

      <div class="divider"></div>

      <div class="bin-selector">
        <div class="bin-row">
          <div class="bin-column bin-column-select">
            <label for="binSelect">选择BIN：</label>
            <select id="binSelect" class="select-box">
              <option value="379240">379240</option>
              <option value="625969">625969</option>
              <option value="552461">552461</option>
            </select>
          </div>
          <div style="width: 3%;"></div>
          <div class="bin-column bin-column-input">
            <label for="customBinInput">自定义BIN(优先)：</label>
            <input type="text" id="customBinInput" class="select-box" placeholder="自定义BIN" maxlength="10">
          </div>
        </div>
      </div>

      <div class="action-buttons">
        <button id="bindCard" class="btn btn-primary">
          一键绑卡
        </button>
        <button id="registerAccount" class="btn btn-secondary">
          一键注册
        </button>
      </div>

      <div class="divider"></div>

      <div class="session-token-box">
        <div class="session-token-label">Session Token：</div>
        <div class="session-token-value" id="sessionTokenValue" title="点击复制">
          <span class="token-text">未检测到</span>
        </div>
      </div>

      <div class="session-endpoint">
        <label for="sessionEndpoint">Session回传地址：</label>
        <input type="text" id="sessionEndpoint" class="select-box" value="http://127.0.0.1:8766" placeholder="http://127.0.0.1:8766">
        <p class="session-endpoint-hint">一键绑卡时会向该地址的 /api/import/session 提交 Session Token</p>
      </div>

      <div class="tmpmail-section">
        <div class="tmpmail-section-title">临时邮箱配置</div>
        <div class="tmpmail-field">
          <label for="tmpmailUsername">账户</label>
          <input type="text" id="tmpmailUsername" placeholder="请输入 tmpmail 用户名" value="bigtian">
        </div>
        <div class="tmpmail-field">
          <label for="tmpmailPassword">密码</label>
          <input type="password" id="tmpmailPassword" placeholder="请输入密码" value="djx1314520..">
        </div>
        <p class="tmpmail-hint">系统会自动调用登录接口获取 Cookie，无需手动粘贴。</p>
        <div class="tmpmail-result">
          <div class="tmpmail-result-email">
            <span class="label">最新邮箱：</span>
            <span id="tmpmailEmail">未生成</span>
          </div>
          <a id="tmpmailQuickLink" href="#" target="_blank" class="tmpmail-link" hidden>打开邮箱</a>
        </div>
      </div>

      <!-- 联系方式 -->
      <div class="contact-info"></div>

    </div>
  </div>

  <script src="public/jq-3.7.1.min.js"></script>
  <script src="public/faker-5.5.3.min.js"></script>
  <script src="utils.js"></script>
  <script src="popup.js"></script>
</body>

</html>
